*Frank Baumgartner
*Replication files for: "Learning to Kill"
*Perspectives on Politics, forthcoming, 2021
*Do file prepared with publication materials, April 25, 2021

cd F:\Replication\


clear
use Fig1.dta


#delimit ;
twoway line ViolentCrimeRate year,
clcolor( black  ) 
clpattern(solid ) 
clwidth(medthick )
xtitle("") 
graphregion(color(white)) 
cmiss(n)
yvarl()
xlabel(1950(10)2020)
ylabel(, nogrid)
ytitle("")
subtitle("FBI Violent Crime Rate", color(black) position(11) justification(left))
legend(off)
saving(FBI.gph, replace)

;
*graph export Fig1-a.tif, replace width(1950)

#delimit ;
twoway line MIP100 year,
clcolor( black  ) 
clpattern(solid ) 
clwidth(medthick )
xtitle("") 
graphregion(color(white)) 
cmiss(n)
yvarl()
xlabel(1950(10)2020)
ylabel(, nogrid)
ytitle("")
subtitle("Most Important Problem", color(black) position(11) justification(left))
legend(off)
saving(MIP.gph, replace)
;
*graph export Fig1-b.tif, replace width(1950)


#delimit ;
twoway line punitiveness year,
clcolor( black  ) 
clpattern(solid ) 
clwidth(medthick )
xtitle("") 
graphregion(color(white)) 
cmiss(n)
yvarl()
xlabel(1950(10)2020)
ylabel(, nogrid)
ytitle("")
subtitle("Public Opinion Punitiveness", color(black) position(11) justification(left))
legend(off)
saving(Enns.gph, replace)
;

*graph export Fig1-c.tif, replace width(1950)


#delimit ;
twoway line MIPStd crimeStd punStd year, 
clcolor(black black  black) 
clpattern(dash solid solid) clwidth(medthick thick medthin) 
ylabel(, nogrid)
xtitle("") 
ytitle("")
graphregion(color(white)) 
xlabel(1950(10)2020)
subtitle("", color(black) position(11) justification(left))
legend(off)
yline(0, lcolor(black) lwidth(thin))
text(0.65 1954 "Punitiveness" , placement(s) size(small) color(black) )
text(3 2001 "Most important" "problem" , placement(e) size(small) color(black) )
text(-.7 2015 "Violent crime rate"  , placement(s) size(small) color(black) )
note("")
saving(3series.gph, replace)
;
*graph export Fig1-d.tif, replace width(1950)

graph combine FBI.gph MIP.gph Enns.gph 3series.gph, graphregion(color(white))
graph export Fig1.tif, replace width(1950)

clear
use Fig2.dta

#delimit ;
twoway line LWOP Strikes year if year>1970,
clcolor(black black ) 
clpattern(solid  longdash) 
clwidth(medthick  medthick)
xtitle(Year) 
graphregion(color(white)) 
cmiss(n)
yvarl()
xlabel(1970(10)2020)
ylabel(0(10)50, nogrid)
ytitle("Cumulative Number of States")
subtitle(, color(black) position(11) justification(left))
text(31.5 2020  "Three Strikes" , placement(w))
text(51.5 2020  "Life without Parole" , placement(w))
legend(off)
;
graph export Fig2.tif, replace width(1950)

clear
use Fig3.dta

#delimit;
graph bar AgeLT30 Age30to60 AgeGT60 , stack  over(year, label(angle(0) labsize(small)))
graphregion(color(white))
bar(1 ,  color(gs12))
bar(2 ,  color(gs8))
bar(3 ,  color(gs0))
title("", span size(medium))
legend(label(3 "Age 60+") label(2 "30 - 60") label(1 "Age < 30")   rows(1) bmargin(medium) span region(margin(medsmall)))
ylabel(,  nogrid)
ytitle("")
note("", span)
text(-3500 50 "Time Period" , placement(s) size(small))
;

graph export Fig3.tif, replace width(1950)

clear
use Fig4.dta

#delimit;
graph bar AgeGroup1 - AgeGroup5, stack percent over(Year, label(angle(45) labsize(small)))
graphregion(color(white))
bar(1 ,  color(gs0))
bar(2 ,  color(gs4))
bar(3 ,  color(gs7))
bar(4 ,  color(gs10))
bar(5 ,  color(gs13))
title("", span size(medium))
legend(label(1 "Age 18-24") label(2 "25-34") label(3 "35-44") label(4 "45-54") label(5 "Age 55+")  rows(1)  span region(margin(medsmall)))
ylabel(,  nogrid)
ytitle("")
note("", span)
;

graph export Fig4.tif, replace width(1950)

clear
use Fig5.dta


#delimit ;
twoway line PctYoung PctOld Year,
clcolor(black black ) 
clpattern(solid  longdash) 
clwidth(medthick  medthick)
xtitle(Year) 
graphregion(color(white)) 
cmiss(n)
yvarl()
xlabel(2000(5)2015)
ylabel(, nogrid)
ytitle("Percent of US Prison Population")
subtitle(, color(black) position(11) justification(left))
text(14.74 2012  "Younger (18 to 24)" , placement(e))
text(8.59 2012  "Older (55 and older)" , placement(e))
legend(off)
;
graph export Fig5.tif, replace width(1950)

clear 
use Fig6.dta

* population by age
gen TPopUnder30= PopUnder20 + Pop20to29
gen TPopUnder40= TPopUnder30+ Pop30to39
gen TPopUnder60= TPopUnder40 + Pop40to49 + Pop50to59 
gen TPopUnder50= PopUnder20 + Pop20to29 + Pop30to39 + Pop40to49 
gen TopOver50= Pop50to59 + Pop60to69 +Pop70to79 + Pop80to89 +Pop90over
*over 50 percentage of population

gen PopOve50pct = (TopOver50*100)/PopT

*under 50 percentage of population

format TPopUnder30 TPopUnder40 TPopUnder60 PopT  %6.0fc
#delimit ;
twoway line TPopUnder30 TPopUnder40 TPopUnder60 PopT  year ,
clcolor(black black black black ) 
clpattern(solid solid solid solid) 
clwidth(medthick medthick medthick medthick)
xtitle("") 
graphregion(color(white)) 
cmiss(n)
yvarl()
xlabel(1975(5)2020)
ylabel(, nogrid)
ytitle("")
subtitle(, color(black) position(11) justification(left))
legend(off)
text(4000 2017 "Age under 30" , placement(w) size(small))
text(13000 2017 "Age under 40" , placement(w) size(small))
text(27000 2017 "Age under 60" , placement(w) size(small))
text(38500 2017.5 "Age 60 + ------>" , placement(w) size(small))
text(41000 2017 "Total" , placement(n) size(small))
;
graph export Fig6.tif, replace width(1950)


gen PopUnder50pct= (TPopUnder50 * 100)/PopT
gen Over49= Pop50to59 + Pop60to69 +Pop70to79 +Pop80to89 +Pop90over
gen Over59= Pop60to69 +Pop70to79 +Pop80to89 +Pop90over
gen Over69= Pop70to79 +Pop80to89 +Pop90over

format Over49 Over59 Over69  %6.0fc
#delimit ;
twoway line Over49 Over59 Over69  year ,
clcolor(black black black  ) 
clpattern(solid solid solid ) 
clwidth( medthick medthick   medthick)
xtitle("") 
graphregion(color(white)) 
cmiss(n)
yvarl()
xlabel(1975(5)2020)
ylabel(, nogrid)
ytitle("")
subtitle(, color(black) position(11) justification(left))
legend(off)
text(100 2020 "Age 70+" , placement(w) size(small))
text(1800 2020 "Age 60+" , placement(w) size(small))
text(6000 2020 "Age 50+" , placement(w) size(small))
;
graph export Fig7.tif, replace width(1950)
